<?php

declare(strict_types=1);

namespace app\model;

use app\BaseModel;
use think\model\concern\SoftDelete;

class ProductImportJob extends BaseModel
{
    use SoftDelete;

    protected $name = 'product_import_job';

    protected $autoWriteTimestamp = 'datetime';

    protected $json = ['mapping', 'options', 'error_log'];

    public const STATUS_PENDING = 'pending';
    public const STATUS_RUNNING = 'running';
    public const STATUS_SUCCESS = 'success';
    public const STATUS_FAILED = 'failed';

    public const NOTIFY_PENDING = 'pending';
    public const NOTIFY_SENT = 'sent';

    protected $type = [
        'started_at' => 'datetime',
        'finished_at' => 'datetime',
        'mapping' => 'json',
        'options' => 'json',
        'error_log' => 'json',
    ];
}
